ZF.add('browser-ext', function(Z) {

    var B = Z.Browser,
        win = window,
        ua = navigator.userAgent.toLowerCase();

    if (ua.match(/360SE/i)) { // 360
        B.se360 = 3;
    } else if (ua.match(/Maxthon/) || win.external) { // maxthon
        var tc, isMaxthon;

        try {
			tc = win.external.tab_count;
			isMaxthon = typeof(tc) != "undefined";
		} catch(e) {}

        if (isMaxthon) {
            B.maxthon = 1;
            try {
                B.MAXVer = win.external.max_version;
                var maxVer = B.MAXVer.split('.');
                B.MAXVerMaj = parseInt(maxVer[0] + maxVer[1] + maxVer[2]) || 0;
                B.maxthon = parseInt(maxVer[0]);
            } catch(e) {}
            B.getMaxVer = function() { return B.MAXVer || ''; };
        }
    } else if (ua.indexOf("tencent") > -1 && win.external) { // tt
        var isTT;
        try {
			win.external.ShowBrowserUI('7k7k');
			isTT = true;
		} catch(e){}

        if (isTT) {
            B.tt = 1;
            try {
                var v = win.external.getTTVerStr();
                if(v.indexOf('Tencent') >= 0) {
                    B.TTVer = v;
                    var ttVer = B.TTVer.replace('Tencent Traveler ', '').split(' ')[0].split('.');
                    B.TTVerMaj = parseInt(ttVer[0] + ttVer[1]) || 0;
                    B.tt = parseInt(ttVer[0]);
                }
            } catch(e) {}
            B.getTTVer = function(){ return B.TTVer ? B.TTVer.replace('Tencent Traveler ', '') : ''; };
        }
    } else if (ua.match(/TheWorld/)) { // theword
        B.theword = 3;
    } else if (m = ua.match(/SE\s([\d.]*)/)) { // sogou
        B.sogou = m[1] ? parseInt(m[1].replace(/\./g, '')) : 1;
    }

});